<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>absolute 绝对定位</title>
  <style>
  * {
    margin: 0;
    padding: 0;
  }
  body {
    background-color: azure;
  }
  .parent {
    width: 550px;
    height: 500px;
    background-color: pink;
    position: relative;
  }
  .child {
    width: 300px;
    height: 200px;
    background-color: skyblue;
    position: absolute;
    right: 100px;
  }
  .box {
    width: 100px;
    height: 100px;
    background-color: green;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  </style>
</head>
<body>
  <div class="parent">
    <div class="child"></div>
    <!-- 绝对定位的元素不会影响到普通流中的元素，所以123会显示在父元素的左上角，即static默认定位 -->
    <div>123</div> 
  </div>
  <div class="box">Hello World</div>
</body>
</html>